import request from '@/utils/request'
// 封装获取角色列表
export const reqGetRoleList = (page, pagesize) => {
  return request({
    method: 'get',
    url: '/sys/role',
    params: {
      page,
      pagesize
    }
  })
}
// 封装删除角色列表
export const reqDelRoleList = (id) => {
  return request({
    method: 'delete',
    url: `/sys/role/${id}`
  })
}
// 封装新增角色功能
export const reqAddRole = (data) => {
  return request({
    method: 'post',
    url: '/sys/role',
    data
  })
}
// 封装编辑功能的接口
export const reqEditRole = (data) => {
  return request({
    method: 'put',
    url: `/sys/role/${data.id}`,
    data
  })
}
// 根据id获取角色详情,用于数剧更新后显示
export const reqGetRoleDetail = (id) => {
  return request({
    method: 'get',
    url: `/sys/role/${id}`
  })
}
// 给角色分配权限
export const reqAssignPrem = (data) => {
  return request({
    method: 'put',
    url: '/sys/role/assignPrem',
    data
  })
}
